﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace VCDepend.Console
{
  public class CommandArgs
  {
    private string m_solutionPath;
    private string m_solutionName;
    private string m_solutionConfiguration;

    public static CommandArgs Parse(string[] args)
    {
      if (!HasRequiredArgs(args))
        throw new RequiredArgsException();

      return new CommandArgs(args[0], args[1]);
    }

    public string SolutionName
    {
      get
      {
        return m_solutionName; 
      }
    }

    public string SolutionConfiguration
    {
      get 
      { 
        return m_solutionConfiguration; 
      }
    }
    
    public string SolutionPath
    {
      get
      {
        return m_solutionPath;
      }
    }

    private CommandArgs(string solutionPath, string solutionConfiguration)
    {
      m_solutionPath = solutionPath;
      m_solutionConfiguration = solutionConfiguration;
      m_solutionName = Path.GetFileName(m_solutionPath);
    }

    private static bool HasRequiredArgs(string[] args)
    {
      return (args.Length == 2);
    }
  }
}
